package com.jxj.util;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @Author Cambria
 * @creat 2021/8/14 21:07
 */
@Slf4j
@Component
public class MetaObjectHandlerImpl implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        this.strictInsertFill(metaObject , "isDeleted" , Integer.class , 0);
        this.strictInsertFill(metaObject , "addTime" , LocalDateTime.class , LocalDateTime.now());
    }

    @Override
    public void updateFill(MetaObject metaObject) {

    }
}
